<template>
	<view class="app-components-goods-list-item e-m-b-16 bg-white " @tap="
			$goTo('/pages/classify/goods/info/index',  {
				id: info.id
			})
		">
		<view class="app-components-goods-list-item__image">
			<image mode="widthFix"  :src="$fullLink(info.coverImg)"></image>
		</view>
		<view class="app-components-goods-list-item__body  e-flex-column e-flex-items-start e-rela">
			<view class="goods-title e-rela e-line-2">
				<text class="self-icon e-m-r-10" v-if="APP_HAS_OWN&&info.hasOwn == 1">
					{{ $t('classify.自营') }}
				</text>
				{{ info.name }}
			</view>
			<!-- 活动信息 -->
			<activityBadge :info="info"></activityBadge>
			<view>
				<view class="price fw-500 c-red">
					<text class="e-font-24">{{$unitEn}}</text>
					<text class="e-font-32">{{ info.price }}</text>
				</view>
				<!-- <view class="e-font-24 c-placeholder">
					<text>{{ $t('common.销量') }}：</text>
					<text>{{ $formatNumberToK(info.stockSold || 0) }}</text>
				</view> -->
			</view>
			<view class="car-icon-button e-abso text-center">
				<text class="iconfont c-primary e-font-36" :class="iconClass" v-if="showIcon"></text>
			</view>
		</view>
	</view>
</template>

<script lang="ts">
	import {
		defineComponent
	} from 'vue'
	export default defineComponent ({
		// #ifdef MP-WEIXIN
		// 将自定义节点设置成虚拟的，更加接近Vue组件的表现
		options: {
			virtualHost: true
		},
		// #endif
	})
</script>
<script setup lang="ts">
	import {
		APP_HAS_OWN
	} from '@/env'
	import type { GoodsItem } from '@/common/request/api'

	const props = withDefaults(defineProps<{
		info : GoodsItem
		showIcon : boolean
		iconClass?:string
	}>(), {
		showIcon: true,
		iconClass:'icon-gouwuche2'
	})
</script>

<style lang="scss" scoped>
	@include appBem_b(components-goods-list-item) {

		border-radius: 10rpx;
		overflow: hidden;

		@include appBem_e(image) {
			width: 100%;
			image{
				width: 100%;
			}
		}

		@include appBem_e(body) {
			padding: 12rpx 20rpx 14rpx 20rpx;

			.goods-title {
				flex: 1;

				.indent {
					padding-left: 10rpx;
				}
			}

			.car-icon-button {
				right: 20rpx;
				bottom: 20rpx;
				// text {
				// 	font-size: 48rpx;
				// }
			}

		}



	}
</style>